from utils.client import APIClient
from utils.yaml_config import get_yaml


data = get_yaml('home.yaml')

class HomeAPI:


    def __init__(self,client:APIClient):
        self.client = client
    
    def home_get(self):
        home_data = data['get']['request']
        return self.client.request(home_data['method'],home_data['path'])
    
    def home_all(self): 
        home_data = data['all']['request']
        return self.client.request(home_data['method'],home_data['path'])
    
    def home_info(self):
        home_data = data['info']['request']
        return self.client.request(home_data['method'],home_data['path'])

    def home_list(self):
        home_data = data['list']['request']
        return self.client.request(home_data['method'],home_data['path'],json=home_data['json'])
    
    def home_overview(self):
        home_data = data['overview']['request']
        return self.client.request(home_data['method'],home_data['path'])
    
    def home_statistics(self,statistics_type):
        home_data = data['statistics']['request']
        return self.client.request(home_data['method'],home_data['path'],json=home_data['json'][statistics_type])
    
    def home_overview2(self,status):
        home_data = data['overview2']['request']
        return self.client.request(home_data['method'],home_data['path'],json=home_data['json'][status])

    